/*
 *  circlePanel.h
 *  opencvExample
 *
 *  Created by 真鍋 大度 on 11/04/22.
 *  Copyright 2011 Rhizomatiks. All rights reserved.
 *
 */


#pragma once
#include "ofMain.h"
#include "warpPoint.h"
#include "ofxOpenCv.h"
#include "ofxVectorMath.h"
#include "ofxXmlSettings.h"
#define NUM_PTS 800
#include "basicParameters.h"





class circlePanel{
public:
	void setup(int _myID);
	void update(int _currentFrame);
	void draw();
	bool loadMovie(string str);
	
	void keyPressed  (int key);
	void mouseMoved(int x, int y ){}
	void mouseDragged(int x, int y, int button);
	void mousePressed(int x, int y, int button);
	void mouseReleased(int x, int y, int button);
	void windowResized(int w, int h);
	void setWarpPoint();
	void setPointsToList();
	void setActive(bool _bAmIActive);
	void toggleActive();	
	int w,h;
	int myID;
	int currentMode;
	ofVideoPlayer 		vidPlayer;
	ofxCvColorImage		colorImg;
	
	// interpol
	bool bInterpol;
	int numInterpol;
	
	// for editing rects
	
	bool bCenter;
	ofPoint ptCenter;
	
	float clickX,clickY;
	
	// warpPoint
	//	warpPoint * warpPoints;
	vector<warpCircle> warpCircleList;
	warpCircle nextWarpPoint;
	warpCircle currentWarpPoint;
	
	int currentFrame;
	int numFrames;
	
	bool bActive;
	//mouse , pos
	float scaleX;
	float scaleY;
	void shift(float _dx, float _dy);
	
	// xml
	ofxXmlSettings XML;	
	string xmlStructure;	
	int pointCount;
	int lineCount;
	int lastTagNumber;
	string message;	
	
	void readXML();
	void saveXML();
	void initXML();
	
	//	ofTrueTypeFont  franklinBook;
	
};

